package cbbx_sm.livecamera;

import java.awt.image.BufferedImage;

import javax.swing.JFrame;

public class ViewerFrame extends JFrame {

		private static final long serialVersionUID = 1L;

		private ImagePanel imagePanel = null;
	
		public ViewerFrame(int startX, int startY, int width, int height) {
			super("JPEGViewer");
			imagePanel = new ImagePanel(this);
			add(imagePanel);
			setVisible(true);
			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			this.setBounds(startX, startY, width, height);
			imagePanel.pin(true);
		}

		public ViewerFrame() {
			super("JPEGViewer");
			imagePanel = new ImagePanel(this);
			add(imagePanel);
			setVisible(true);
			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		}

		public void updateImage(BufferedImage image) {
			this.imagePanel.setImage(image);
		}
		
		public void updateImage(BufferedImage image,String status) {
			this.imagePanel.setImage(image,status);
		}

		public void updateImage(BufferedImage[] image, String[] status) {
			this.imagePanel.setImage(image,status);
			repaint();
		}
}
